package com.kuang.service;

import com.kuang.dao.PaperMapper;
import com.kuang.pojo.Paper;
import com.kuang.pojo.Qquestion;
import com.kuang.pojo.Uuser;
import oracle.sql.DATE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class PaperServiceImpl implements PaperService {

    @Autowired
    private PaperMapper PaperMapper;

    public void setPaperMapper(com.kuang.dao.PaperMapper paperMapper) {
        PaperMapper = paperMapper;
    }

    public void addPaper(int eid,int order) {
        HashMap<String,Object> map = new HashMap<String,Object>();
        map.put("v_eid", eid);
        map.put("v_order",order);
        PaperMapper.addPaper(map);
        System.out.println("试题都加好了奥");
    }


    public void updatePaper(int EID, int  QNUM,String SELECT_ANS, String START_TIME, String END_TIME) {
        PaperMapper.updatePaper(EID,QNUM,SELECT_ANS,START_TIME,END_TIME);
    }

    public int getGrade(int eid) {
        return PaperMapper.getGrade(eid);
    }

    public List<Paper> allPaper(int eid) {
        return PaperMapper.allPaper(eid);
    }

    public List<Qquestion> addTest(){
        return  PaperMapper.addTest();
    }
    public List<Qquestion> getWrong() {
        return PaperMapper.getWrong();
    }

}
